<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>天气案例</title>
  </head>

  <body>
    <div id="app">
      <!-- <h1 v-show="isShow">今天的天气很凉爽</h1>
      <h1 v-show="!isShow">今天的天气很炎热</h1> -->
      <h1>今天的天气很{{info}}</h1>
      <button @click="changeClimate">切换天气</button>
    </div>
  </body>
  <script src="../js/vue.js"></script>
  <script>
    new Vue({
      el: "#app",
      data: {
        isShow: true
      },
      methods: {
        changeClimate() {
          return this.isShow = !this.isShow
        }
      },
      computed: {
        info() {
          return this.isShow ? '炎热' : '凉爽'
        }
      }
    })
  </script>


</html>